import { PropsWithChildren } from 'react'
import { useLaunch } from '@tarojs/taro'
import { useAuthStore } from '@/store'
import "@taroify/icons/index.scss"
import "@taroify/core/index.scss"
import "./styles/reset.css"
import "./styles/iconfont.css"
import "./styles/iconfont-fuli.css"
import "./styles/html.css"
import "./styles/common.css"

if (__SUPPORT_TW__) {
  require("@/platform/styles/tw/app.css")
} else {
  require("@/platform/styles/tw/app.mini.css")
}

function App({ children }: PropsWithChildren<any>) {
  useLaunch(() => {
    console.log('App launched.')
    const authStore = useAuthStore.getState()
    authStore.fetchMemberProfile()
  })

  // children 是将要会渲染的页面
  return children
}

export default App
